// Copyright (c) 2011 Sundog Software LLC. All rights reserved worldwide.

using System;

public class SilverLiningSolarSpectrum : SilverLiningSpectrum
{
    protected double[,] rawNasaData = new double[2, 122] { { 0.3, 0.305, 0.31, 0.315, 0.32, 0.325, 0.33, 0.335, 0.34, 0.345,
    0.35, 0.36, 0.37, 0.38, 0.39, 0.4, 0.41, 0.42, 0.43, 0.44,
    0.45, 0.46, 0.47, 0.48, 0.49, 0.5, 0.51, 0.52, 0.53, 0.54,
    0.55, 0.57, 0.593, 0.61, 0.63, 0.656, 0.6676, 0.69, 0.71, 0.718,
    0.7244, 0.74, 0.7525, 0.7575, 0.7625, 0.7675, 0.78, 0.8, 0.816, 0.8237,
    0.8315, 0.84, 0.86, 0.88, 0.905, 0.915, 0.925, 0.93, 0.937, 0.948,
    0.965, 0.98, 0.9935, 1.04, 1.07, 1.1, 1.12, 1.13, 1.145, 1.161,
    1.17, 1.2, 1.24, 1.27, 1.29, 1.32, 1.35, 1.395, 1.4425, 1.4625,
    1.477, 1.497, 1.52, 1.539, 1.558, 1.578, 1.592, 1.61, 1.63, 1.646,
    1.678, 1.74, 1.8, 1.86, 1.92, 1.96, 1.985, 2.005, 2.035, 2.065,
    2.1, 2.148, 2.198, 2.27, 2.36, 2.45, 2.5, 2.6, 2.7, 2.8,
    2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0 },

    { 535.9, 558.3, 622.0, 692.7, 715.1, 832.9, 961.9, 931.9, 900.6, 911.3,
    975.5, 975.9, 1119.9, 1103.8, 1033.8, 1479.1, 1701.3, 1740.4, 1587.2, 1837.0,
    2005.0, 2043.0, 1987.0, 2027.0, 1896.0, 1909.0, 1927.0, 1831.0, 1891.0, 1898.0,
    1892.0, 1840.0, 1768.0, 1728.0, 1658.0, 1524.0, 1531.0, 1420.0, 1399.0, 1374.0,
    1373.0, 1298.0, 1269.0, 1245.0, 1223.0, 1205.0, 1183.0, 1148.0, 1091.0, 1062.0,
    1038.0, 1022.0, 998.7, 947.2, 893.2, 868.2, 829.7, 830.3, 814.0, 786.9,
    768.3, 767.0, 757.6, 688.1, 640.7, 606.2, 585.9, 570.2, 564.1, 544.2,
    533.4, 501.6, 477.5, 442.7, 440.0, 416.8, 391.4, 358.9, 327.5, 317.5,
    307.3, 300.4, 292.8, 275.5, 272.1, 259.3, 246.9, 244.0, 243.5, 234.8,
    220.5, 190.8, 171.1, 144.5, 135.7, 123.0, 123.8, 113.0, 108.5, 97.5,
    92.4, 82.4, 74.6, 68.3, 63.8, 49.5, 48.5, 38.6, 36.6, 32.0,
    28.1, 24.8, 22.1, 19.6, 17.5, 15.7, 14.1, 12.7, 11.5, 10.4,
    9.5, 8.6 } };

    public SilverLiningSolarSpectrum ()
    {
        int numElements = 122;
        
        int elem = 1;
        
        double wavelength = 0.380;
        
        for (int i = 0; i < NSAMPLES; i++) {
            double um = wavelength + SAMPLEWIDTH * 0.001;
            
            while (elem < (numElements - 1) && rawNasaData[0, elem] <= um) {
                elem++;
            }
            
            powers[i] = rawNasaData[1, elem];
            
            wavelength += SAMPLEWIDTH * 0.001;
        }
    }
}


